/**
 * @file muti_thread.cpp
 * @author your name (you@domain.com)
 * @brief 
 * @version 0.1
 * @date 2022-03-24
 * 参考示例: https://en.cppreference.com/w/cpp/thread/thread/thread
 * @copyright Copyright (c) 2022
 * ToDo:
 * std::lock_guard<std::mutex>是怎么使用的？
 */
#include <thread>
#include <atomic>
#include <iostream>

int main_multi()
{
    std::cout << "test atomic ..." << std::endl;
    std::atomic <int> cnt{0};
    auto f = [&](){cnt ++;};
    std::thread t1{f}, t2{f}, t3{f};
    t1.join();
    t2.join();
    t3.join();
    return 0;
}
